package com.kede.app.domain;

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @description /
* @author Pr.li
* @date 2023-05-11
**/
@Entity
@Data
@Table(name="sy_virtual")
public class Virtual implements Serializable {
    /**
    * 虚拟的最小值
    */
    @ApiModelProperty(value = "虚拟的最小值")
    @Column(name = "`min`")
    private Integer min;
    /**
    * 虚拟的最大值
    */
    @ApiModelProperty(value = "虚拟的最大值")
    @Column(name = "`max`")
    private Integer max;
    /**
    * 执行频率  Cron
    */
    @ApiModelProperty(value = "执行频率  Cron")
    @Column(name = "`cron`")
    private String cron;
    /**
    * 虚拟标识说明 牵记不可改
    */
    @ApiModelProperty(value = "虚拟标识说明 牵记不可改")
    @Id
    @Column(name = "`name`")
    private String name;
    /**
    * 
    */
    @ApiModelProperty(value = "createTime")
    @Column(name = "`create_time`")
    private Timestamp createTime;
    /**
    * 
    */
    @ApiModelProperty(value = "updateTime")
    @Column(name = "`update_time`")
    private Timestamp updateTime;
    /**
    * 存放虚拟值
    */
    @ApiModelProperty(value = "存放虚拟值")
    @Column(name = "`value`")
    private Long value;

    public void copy(Virtual source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
